package com.miao.teacher.widget;



import com.miao.teacher.ui.R;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class WaitingDialog extends Dialog {
	private static final String TAG = "WaitingDialog";

	private TextView textViewPrompt;
	private String prompt;

	public WaitingDialog(Context context, String text) {
		super(context, R.style.waitingDialogStyle);
		prompt = text;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_waiting);
		textViewPrompt = (TextView) this.findViewById(R.id.textview_dialog);
		textViewPrompt.setText(prompt);
		setCanceledOnTouchOutside(false);
		setCancelable(false);
		Log.d(TAG, "WaitingDialog.onCreate(), text = " + prompt);
	}

	public void show(String text) {
		prompt = text;
		textViewPrompt.setText(prompt);
		show();
	}
}
